import groovy.sql.Sql

def sql = Sql.newInstance("jdbc:hsqldb:mem:mydb", "sa", "", "org.hsqldb.jdbcDriver")

sql.execute("create table user(id int, name varchar(255), password varchar(255))")

sql.execute("insert into user(id, name, password) values (?,?,?)", [1, "kongxx", "kongxx"])
sql.execute("insert into user(id, name, password) values (?,?,?)", [2, "mandy", "mandy"])

sql.eachRow("select * from user", { println it.name})

